/*
 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Autogenerated file -- DO NOT EDIT!

#ifndef PANDA_RUNTIME_SHORTY_VALUES_H_
#define PANDA_RUNTIME_SHORTY_VALUES_H_

% PandaFile::types.each do |type|
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_<%= type.name.upcase %> 0x<%= type.code.to_s(16) %>
%end

% first_nonvoid = PandaFile::types.select {|type| type.name != "void"}.first.code
% first_32 = PandaFile::types.select {|type| type.width && type.width == 32}.first.code
% last_int32 = PandaFile::types.select {|type| type.width && type.width == 32 && type.properties.include?("integral")}.last.code
% first_64 = PandaFile::types.select {|type| (type.width && type.width == 64)}.first.code
% first_float = PandaFile::types.select {|type| type.properties.include?("float") }.first.code
% num_32_and_larger = PandaFile::types.select {|type| type.width && type.width >= 32 || type.name == "reference" || type.name == "tagged" }.length
% num_float_types = PandaFile::types.select {|type| type.properties.include?("float") }.length
% num_64bit_types = PandaFile::types.select {|type| (type.width && type.width == 64)}.length
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_FIRST_NONVOID 0x<%= first_nonvoid.to_s(16) %>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_FIRST_32 0x<%= first_32.to_s(16) %>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_LAST_INT32 0x<%= last_int32.to_s(16) %>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_FIRST_64 0x<%= first_64.to_s(16) %>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_FIRST_FLOAT 0x<%= first_float.to_s(16) %>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_NUM_MIN32_TYPES <%= num_32_and_larger %>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_NUM_FLOAT_TYPES <%= num_float_types %>
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SHORTY_NUM_64BIT_TYPES <%= num_64bit_types %>

#endif  // PANDA_RUNTIME_SHORTY_VALUES_H_

